package com.cms.recursoshumanos.handler;

import com.cms.recursoshumanos.activity.main.MainRecursosHumanosActivity;
import com.cms.recursoshumanos.cache.UserInfoCache;
import com.cms.recursoshumanos.constant.Constant;
import com.cms.recursoshumanos.facade.ListaFamiliarActivityFacade;

public class ListaFamiliarActivityHandler
{

	public ListaFamiliarActivityHandler()
	{
		
	}
	public String facadeListaFamiliarScreen(String username, String password)
	{
		ListaFamiliarActivityFacade lista_familiar_facade = new ListaFamiliarActivityFacade(
																							username,
																							password);
		return lista_familiar_facade.enviarSolicitud();
	}
	public String refreshListaFamiliar (String username, String password)
	{
		return this.facadeListaFamiliarScreen(username, password);
	}
	public String getListaFamiliar (String username, String password)
	{
		if ( UserInfoCache.getInstance().lista_vacia(2)
				|| UserInfoCache.getInstance().cache_utilizable(1, MainRecursosHumanosActivity.getAppContext()))
		{
			return this.facadeListaFamiliarScreen(username, password);
		}
		else
		{
			return Constant.CODE_OK;
		}
			
	}

}

